package com.app.studentActivity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.app.R;
import com.app.bean.NoticeBean;
import com.app.bean.QiyeBean;

import java.util.ArrayList;
import java.util.List;

public class QiyeDetail extends AppCompatActivity {

    private TextView name, content;
    private ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_qiye_detail);
        initView();

        QiyeBean bean = (QiyeBean) getIntent().getSerializableExtra("bean");
        int id = getIntent().getIntExtra("id", 0);
        name.setText(bean.getTitle());
        content.setText(bean.getContent());
        List<Integer> list = new ArrayList<>();
        list.add(R.drawable.g1);
        list.add(R.drawable.g2);
        list.add(R.drawable.g3);
        list.add(R.drawable.g4);
        list.add(R.drawable.g5);
        imageView.setImageResource(list.get(id));
    }

    private void initView() {
        Toolbar toolbar = findViewById(R.id.toolbar);
        toolbar.getChildAt(0).setOnClickListener(v -> finish());
        ((TextView) toolbar.getChildAt(1)).setText("企业详细");
        name = findViewById(R.id.name);
        content = findViewById(R.id.content);
        imageView = findViewById(R.id.detail_image);
    }
}